package com.accedo.achievements.services.ajax;

import net.sf.json.JSONObject;

public interface UserService {
	/**
	 * Get user's friends with friends' relevant profile information.
	 * @param username	user name
	 * @return			JSON friends<br>
	 * eg. {friends:[{friend_name:'Sebbe', friend_id:'9'},{friend_name:'Peter', friend_id:'8'},
	 * {friend_name:'Johan', friend_id:'7'},{friend_name:'Viktor', friend_id:'6'}]}
	 */
	public JSONObject getJsonFriendsByUsername(String username);
	
	/**
	 * Search the users by using inputString for fuzzy query
	 * <p>the fuzzy query only return the profile of the people who are not this user's friends.
	 * @param username		user name
	 * @param inputString	the input string for fuzzy query
	 * @return				JSON format users<br>
	 * eg. {friends:[{friend_name:'Cristian', friend_id:'13'},{friend_name:'Andres', friend_id:'3'},]}
	 */
	public JSONObject getJsonNoneFriendsByInputString(String username, String inputString);
	
	/**
	 * Get the specific user's score value.
	 * @param username 	user name
	 * @return 			user score
	 */
	public long getScoreByUsername(String username);
	
	/**
	 * Get the specific user's profile information.
	 * @param username 	user name
	 * @return 			JSON format user<br>
	 * eg. {userid:'1', score:'190', level:'0', username:'Bosse'}
	 */
	public JSONObject getJsonUserByUsername(String username);
	
	/**
	 * Get all users' score value.
	 * @return all users score in Json<br>
	 * eg. {users:[{username:'Sebbe', score:'800'},{username:'Johan', score:'750'},{username:'Viktor', score:'600'},{username:'Thomas', score:'500'}]}
	 */
	public JSONObject getAllJsonUsersScore();
}
